import { createRouter, createWebHashHistory } from 'vue-router'
import Layout from '@/layout'

const routers = [{
  path: '/',
  redirect: '/home/index'
}, {
  path: '/login',
  name: 'Login',
  component: () => import('@/views/login/index')
}, {
  path: '/home',
  component: Layout,
  redirect: '/home/index',
  children: [{
    path: 'index',
    component: () => import('@/views/home/index'),
    meta: { title: '首页', icon: 'icon-aislogo' }
  }]
},
{
  path: '/example',
  component: Layout,
  redirect: '/example/table',
  meta: { title: '例子', icon: 'el-icon-phone' },
  children: [{
    path: 'table',
    name: 'Table',
    component: () => import('@/views/table/index'),
    meta: { title: '表格', icon: 'el-icon-phone' }
  }, {
    path: 'tree',
    name: 'Tree',
    component: () => import('@/views/tree/index'),
    meta: { title: '树状', icon: 'el-icon-phone' }
  }]
}]
export const router = createRouter({
  history: createWebHashHistory(),
  routes: routers
})
